package com.globisoft.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.globisoft.dao.GoodReceivedNoteDao;
import com.globisoft.domain.GRN;
import com.globisoft.service.GoodReceivedNoteService;
import com.globisoft.util.ComboBoxObject;

@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class GoodReceivedNoteServiceImpl implements GoodReceivedNoteService {

	@Autowired
	GoodReceivedNoteDao goodReceivedNoteDao;
	
	public void setGoodReceivedNoteDao(GoodReceivedNoteDao goodReceivedNoteDao) {
		this.goodReceivedNoteDao = goodReceivedNoteDao;
	}


	@Override
	public boolean saveGRN(GRN grn) {
		
		return goodReceivedNoteDao.saveGRN(grn);
	}


	@Override
	public List<ComboBoxObject> getAllGRNType() {
		return goodReceivedNoteDao.getAllGRNType();
	}


	@Override
	public List<ComboBoxObject> getAllPurchaseOrder() {
		return goodReceivedNoteDao.getAllPurchaseOrder();
	}

	public List<ComboBoxObject> getSuppliersByPurchaseOrder(int purchaseOrderId) {
		return goodReceivedNoteDao.getSuppliersByPurchaseOrder(purchaseOrderId);
	}

}
